package org.lemon.transport.context.auth;

import lombok.Data;

@Data
public class DeviceAuthResult {

    private final boolean success;

    private final Long deviceId;

    private final String errorMsg;

    public DeviceAuthResult(boolean success, Long deviceId, String errorMsg) {
        this.success = success;
        this.deviceId = deviceId;
        this.errorMsg = errorMsg;
    }

    public static DeviceAuthResult success(Long deviceId) {
        return new DeviceAuthResult(true, deviceId, null);
    }

    public static DeviceAuthResult fail(String errorMsg) {
        return new DeviceAuthResult(false, null, errorMsg);
    }

}
